<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:s="http://jboss.org/seam/faces"
	template="/resources/forge-template.xhtml">

	<ui:define name="metadata">
		<f:metadata>
			<s:viewAction action="#{conversation.end}"
				if="#{not conversation.transient}" immediate="true" />
		</f:metadata>
	</ui:define>
	
	<ui:param name="pageTitle" value="List Comments of Post" />

	<ui:define name="header">
		Comments of Post
	</ui:define>

	<ui:define name="subheader">
		Listing all posts.
	</ui:define>

	<ui:define name="footer">
	</ui:define>

	<ui:define name="main">
		<h:form id="form">

			<h:messages />


			<br />

			<ul>
				<ui:repeat var="entity" value="#{commentHome.dataModel}">
					<li>#{entity.id} @#{entity.title}
						<h:commandLink value="[View Comments]">
							<f:setPropertyActionListener target="#{commentHome.currentPost}" value="#{entity}"></f:setPropertyActionListener>
							<f:ajax execute="@this" render=":commentsTable"/>
						</h:commandLink>
					</li>
				</ui:repeat>
			</ul>
		</h:form>
		
		<h:dataTable id="commentsTable" value="#{commentHome.currentPost.comments}" var="c">
			<h:column>
				<f:facet name="header">
					Content
				</f:facet>
				#{c.content}
			</h:column>
		</h:dataTable>
	</ui:define>

	<ui:define name="left">
		<h3>Get involved</h3>
		<p>
			If you would like to get involved in this project, please visit the <a
				href="http://bit.ly/seamforge">Forge homepage</a> or visit the
			#seam-dev IRC channel: <a href="irc://chat.freenode.net/#seam-dev">freenode.net#seam-dev</a>
			and ask about "Forge"
		</p>
		<p>
			If you have an idea for a plugin or improvement, and would like to do
			some "forgestorming", submit it <a href="http://bit.ly/forgestorm">here</a>.
		</p>

		<h3>Useful links</h3>
		<ul>
			<li>Seam 3: <a href="http://seamframework.org/Seam3">Home</a></li>
			<li>JBoss.org: <a href="http://jboss.org">Home</a></li>
		</ul>
	</ui:define>

</ui:composition>


